import { createRouter, createWebHashHistory } from 'vue-router'

// 默认加载的路由
const routes = [
  {
    path: '/index',
    name: 'index',
    component: () => import('../views/index/index'),
    redirect: '/index',
    children:[
      {
        path: '/index',
        name: '招聘',
        component: () => import('../views/index/recruitment/index')
      },
      {
        path: '/adminlogin',
        name: '管理员登录',
        component: () => import('../views/index/adminlogin/index')
      },
      {
        path: '/apply',
        name: '申请',
        component: () => import('../views/index/apply/index')
      },
      {
        path: '/information',
        name: '个人基本信息',
        component: () => import('../views/index/information/index')
      },
      {
        path: '/findcoach',
        name: '找教练',
        component: () => import('../views/student/findcoach/index')
      },
      {
        path: '/carpractise',
        name: '练车场地',
        component: () => import('../views/teacher/carpractise/index')
      },
      {
        path: '/carexam',
        name: '考试预约',
        component: () => import('../views/student/carexam/index')
      },
      {
        path: '/mystatus',
        name: '我的状态',
        component: () => import('../views/student/mystatus/index')
      },
      {
        path: '/carpractises',
        name: '练车预约',
        component: () => import('../views/student/carpractises/index')
      },
      {
        path: '/carstudent',
        name: '学员状态',
        component: () => import('../views/teacher/carstudent/index')
      },
      {
        path: '/examstatus',
        name: '考场状态',
        component: () => import('../views/teacher/examstatus/index')
      },
      {
        path: '/fourmm',
        name: '论坛',
        component: () => import('../views/index/fourm/index')
      },
      {
        path: '/mypost',
        name: '我的帖子',
        component: () => import('../views/index/fourm/mypost')
      },
      {
        path: '/onepost',
        name: '一条帖子',
        component: () => import('../views/index/fourm/onepost')
      },
      {
        path: '/post',
        name: '发布帖子',
        component: () => import('../views/index/fourm/post')
      }
    ]
  },
    //管理员端
  {
    path: '/',
    name: '首页',
    component: () => import('../layout/index'),
    redirect: '/',
    children: [
      {
        path:'/',
        name:'',
        component: () => import('../views/admin/index')
      },
      {
        path:'/teacher',
        name:'教练管理',
        component: () => import('../views/admin/people/teacher')
      },
      {
        path:'/student',
        name:'学员管理',
        component: () => import('../views/admin/people/student')
      },
      {
        path:'/practise',
        name:'练车场管理',
        component: () => import('../views/admin/place/practise')
      },
      {
        path:'/examplace',
        name:'考场管理',
        component: () => import('../views/admin/place/examplace')
      },
      {
        path:'/practisestatus',
        name:'练车状态',
        component: () => import('../views/admin/status/practisestatus')
      },
      {
        path:'/appointmentstatus',
        name:'考试状态',
        component: () => import('../views/admin/status/appointmentstatus')
      },
      {
        path:'/forum',
        name:'发帖信息',
        component: () => import('../views/admin/forum/sender')
      },
      {
        path:'/sender',
        name:'回帖信息',
        component: () => import('../views/admin/forum/reply')
      },
      {
        path:'/evaluation',
        name:'教练评价',
        component: () => import('../views/admin/other/evaluation')
      },
      {
        path:'/recruitment',
        name:'招聘信息',
        component: () => import('../views/admin/other/recruitment')
      },
    ]
  },
  {
    path: '/login',
    name: '登录',
    component: () => import('../views/index/login/index')
  }
]


const router = createRouter({
  base:'/static/',
  history: createWebHashHistory('static'),
  routes
})

export default router
